<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Amaze UI Admin index Examples</title>
<meta name="description" content="这是一个 index 页面">
<meta name="keywords" content="index">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="icon" type="image/png"
	href="${ctxPath}/static/assets/i/favicon.png">
<link rel="apple-touch-icon-precomposed"
	href="${ctxPath}/static/assets/i/app-icon72x72\@2x.png">
<meta name="apple-mobile-web-app-title" content="Amaze UI" />
<link rel="stylesheet"
	href="${ctxPath}/static/assets/css/amazeui.min.css" />
<link rel="stylesheet"
	href="${ctxPath}/static/assets/css/amazeui.datatables.min.css" />
<link rel="stylesheet" href="${ctxPath}/static/assets/css/app.css">
<script src="${ctxPath}/static/assets/js/jquery.min.js"></script>
</head>
<body data-type="login">
	<script src="${ctxPath}/static/assets/js/theme.js"></script>
	<div class="am-g tpl-g">
		<!-- 风格切换 -->
		<div class="tpl-skiner">
			<div class="tpl-skiner-toggle am-icon-cog"></div>
			<div class="tpl-skiner-content">
				<div class="tpl-skiner-content-title">选择主题</div>
				<div class="tpl-skiner-content-bar">
					<span class="skiner-color skiner-white" data-color="theme-white"></span>
					<span class="skiner-color skiner-black" data-color="theme-black"></span>
				</div>
			</div>
		</div>
		<div class="tpl-login">
			<div class="tpl-login-content">
				<div class="tpl-login-logo"></div>
				<form class="am-form tpl-form-line-form" id="login-form" action="${ctxPath}/login" method="post">
					<div class="am-form-group">
						<input type="text" class="tpl-form-input" value="admin" id="user-name" name="username" data-error="用户名或密码错误"
							placeholder="请输入账号">
					</div>

					<div class="am-form-group">
						<input type="password" class="tpl-form-input" value="admin" id="user-name" name="password"
							placeholder="请输入密码">
					</div>
					<div class="am-form-group tpl-login-remember-me">
						<input id="remember-me" type="checkbox"> <label
							for="remember-me"> 记住密码 </label>
					</div>

					<div class="am-form-group">
						<button type="button" id="login-btn"
							class="am-btn am-btn-primary  am-btn-block tpl-btn-bg-color-success  tpl-login-btn">提交</button>

					</div>
				</form>
			</div>
		</div>
	</div>
	<script src="${ctxPath}/static/assets/js/amazeui.min.js"></script>
	<script src="${ctxPath}/static/assets/js/app.js"></script>
<script type="text/javascript" src="${ctxPath!}/static/layer/layer.min.js"></script>
		<script type="text/javascript" src="${ctxPath}/static/validate/Validform_v5.3.2_min.js"></script>

		<script type="text/javascript">
			function refresh(obj) {
		        obj.src = "${ctxPath!}/captcha?width=120&height=32&"+Math.random();
		    };

			jQuery(function($) {
				$("#login-form").Validform({
					btnSubmit:"#login-btn",
					ajaxPost:true,
					beforeSubmit:function(curform){
						$("#login-btn").attr("disabled","disabled").text("登录中…");
					},
					callback:function(data){
						if(undefined != data.error){
							$("#login-btn").removeAttr("disabled").text("登 录");
							var obj = $("#login-form input[data-error='"+data.error+"']");
							layer.tips(data.error,obj, {
								guide:0,
								time: 4,
								style : ['background-color:#F26C4F; color:#fff','#F26C4F' ],
							});
						}else{
							window.location.href = "${ctxPath!}/index";
						}
					},
					tiptype : function(msg, o, cssctl) {
						if (!o.obj.is("form")) {
							if (o.type != 2) {
								layer.tips(msg, o.obj, {
									guide:3,
									time: 4,
									style : ['background-color:#F26C4F; color:#fff','#F26C4F' ],
								});
							}
						}
					},
					tipSweep : true
				});
				
				$("#login-form").keydown(function(e){
					 var e = e || event,
					 keycode = e.which || e.keyCode;
					 if (keycode==13) {
					  $("#login-btn").trigger("click");
					 }
				});
				
			});
		</script>
</body>

</html>